package com.yidi.system.service;

import com.yidi.common.core.domain.entity.SysRole;
import com.yidi.common.core.page.MyPage;
import com.yidi.common.core.service.BaseService;
import com.yidi.system.domain.SysUserRole;
import org.springframework.data.domain.Page;
import java.util.List;
import java.util.Set;

/**
 * @author ：Xn
 * @ClassName: SysRoleService
 * @date ：2021-10-19 14:38
 * @describe ：
 */
public interface SysRoleService extends BaseService<SysRole> {

    MyPage<SysRole> findByPage(SysRole role, Integer pageNo, Integer pageSize);

    void checkRoleDataScope(Long roleId);

    String checkRoleNameUnique(SysRole role);

    String checkRoleKeyUnique(SysRole role);

    void insertRole(SysRole role);

    void checkRoleAllowed(SysRole role);

    void updateRole(SysRole role);

    void authDataScope(SysRole role);

    void updateRoleStatus(SysRole role);

    void deleteRoleByIds(Long[] roleIds);

    int countUserRoleByRoleId(Long roleId);

    void deleteAuthUser(SysUserRole userRole);

    void deleteAuthUsers(Long roleId, Long[] userIds);

    void insertAuthUsers(Long roleId, Long[] userIds);

    List<Long> selectRoleListByUserId(Long userId);

    List<SysRole> selectRolesByUserId(Long userId);

    Set<String> selectRolePermissionByUserId(Long userId);

}
